function backHome() {
    jQuery.jCookie("hiconIndex", "false"), jQuery.jCookie("tabbarIndex", "false");
}

function createIconMenu(a) {
    var d, e, f, g, b = $(".nav_icon_h"), c = $(".tab_bar_content");
    c.css({
        position: "relative",
        top: "0px",
        right: "0px"
    }), $.each(a.list, function(a, d) {
        var g, h, i, j, k, l, m, e = $('<div class="nav_icon_h_item"><a><div class="nav_icon_h_item_img"></div><div class="nav_icon_h_item_text"></div></a></div>'), f = e.find("a");
        d.link && f.attr("href", d.link), d.target && f.attr("target", d.target), d.name && e.find(".nav_icon_h_item_text").text(d.name), 
        d.icon && (g = $("<img/>"), g.attr("src", d.icon), e.find(".nav_icon_h_item_img").append(g)), 
        b.append(e), d.id && (f.attr("id", d.id), d.clickHandler && (1 == d.clickHandler || "true" == d.clickHandler) && f.click(function() {
            changeLeftMenu(d.id, d.name);
        })), d.children && (h = -1, d.maxnum && (h = parseInt(d.maxnum)), i = 2, j = 0, 
        k = $('<ul style="display:none;" class="menuItemContainer"></ul>'), c.append(k), 
        l = $('<div class="menuItemButtonLeft" style="display:none"></div>'), m = $('<div class="menuItemButtonRight" style="display:none"></div>'), 
        c.append(l), c.append(m), l.bind("mousedown", function() {
            timer = setInterval(function() {
                return i > 17 ? (i = 18, k.css("left", i), clearInterval(timer), void 0) : (i += 8, 
                k.css("left", i), void 0);
            }, 30);
        }), l.bind("mouseup", function() {
            clearInterval(timer);
        }), m.bind("mousedown", function() {
            $(this).next("ul"), timer = setInterval(function() {
                return i > 18 ? (i = 17, clearInterval(timer), void 0) : itemContainerWidth - j > i ? (i = itemContainerWidth - j, 
                clearInterval(timer), void 0) : (i -= 8, k.css("left", i), void 0);
            }, 30);
        }), m.bind("mouseup", function() {
            clearInterval(timer);
        }), $('<li class="popupMenu nav_more"><div class="popupMenu_link nav_more_link"></div><div class="popupMenu_con white_con nav_more_con"></div></li>'), 
        $.each(d.children, function(a, b) {
            var c = $('<li class="item"><a></a></li>'), d = c.find("a");
            b.name && d.text(b.name), b.link && d.attr("href", b.link), b.target && d.attr("target", b.target), 
            b.title && d.attr("title", b.title), k.append(c), b.id && (d.attr("id", b.id), b.clickHandler && (1 == b.clickHandler || "true" == b.clickHandler) && c.click(function() {
                changeLeftMenu(b.id, b.name);
            })), j += 110;
        }), k.data("itemTotalWidth", j), k.append('<div class="clear"></div>'), c.append(k));
    }), b.append('<div class="clear"></div>'), d = 0, e = jQuery.jCookie("hiconIndex"), 
    "false" == e || (d = parseInt(e), isNaN(d) && (d = 0)), $(".tab_bar_content >ul").eq(d).show(), 
    $(".tab_bar_content .menuItemButtonLeft").eq(d).show(), $(".tab_bar_content .menuItemButtonRight").eq(d).show(), 
    currentIdx = d, $(".nav_icon_h_item >a").each(function(b) {
        if ($(this).click(function() {
            $(".nav_icon_h_item >a").removeClass("current"), $(this).addClass("current"), $(".tab_bar_content >ul").hide(), 
            $(".tab_bar_content >ul").eq(b).show(), $(".tab_bar_content .menuItemButtonLeft").hide(), 
            $(".tab_bar_content .menuItemButtonRight").hide(), $(".tab_bar_content .menuItemButtonLeft").eq(b).show(), 
            $(".tab_bar_content .menuItemButtonRight").eq(b).show(), currentIdx = b, resetItemHandler(), 
            jQuery.jCookie("hiconIndex", b.toString());
        }), b == d) if ("single" == a.type) {
            var c = $(this).attr("id");
            listData = getListData(c, $(this).text());
        } else $(this).addClass("current");
    }), f = -1, g = jQuery.jCookie("tabbarIndex"), "false" == g || (f = parseInt(g), 
    isNaN(f) && (f = 0)), $(".tab_bar_content li a").each(function(a) {
        if ($(this).click(function() {
            if ($(".tab_bar_content li a").removeClass("current"), $(this).addClass("current"), 
            null != $(this).attr("target")) {
                var b = uncompile(quiLanguage.progressBar.title);
                progressFlag = 2, showSimpleProgress(b, 0, !0, "#ffffff");
            }
            jQuery.jCookie("tabbarIndex", a.toString());
        }), a == f) {
            $(this).addClass("current");
            var b = $(this).attr("id");
            try {
                listData = getListData(b, $(this).text());
            } catch (c) {}
        }
    }), resetItemHandler();
}

function changeLeftMenu(a, b) {
    try {
        listData = getListData(a, b);
    } catch (c) {}
    null != listData && document.getElementById("frmleft").contentWindow.initLeftMenu(listData);
}

function mainResizeHandler() {
    resetItemHandler();
}

function resetItemHandler() {
    var b, a = document.documentElement.clientWidth;
    itemContainerWidth = a - 400, $(".tab_bar_content").width(itemContainerWidth), b = $(".tab_bar_content").find(".menuItemContainer").eq(currentIdx), 
    b.css("left", 18), b.find("li").length, currentItemTotalWidth = $(".tab_bar_content").find(".menuItemContainer").eq(currentIdx).data("itemTotalWidth"), 
    currentItemTotalWidth > itemContainerWidth ? ($(".tab_bar_content").find(".menuItemButtonLeft").eq(currentIdx).show(), 
    $(".tab_bar_content").find(".menuItemButtonRight").eq(currentIdx).show(), $(".tab_bar_content").find(".menuItemContainer").eq(currentIdx).css("left", 18)) : ($(".tab_bar_content").find(".menuItemButtonLeft").eq(currentIdx).hide(), 
    $(".tab_bar_content").find(".menuItemButtonRight").eq(currentIdx).hide(), $(".tab_bar_content").find(".menuItemContainer").eq(currentIdx).css("left", itemContainerWidth - currentItemTotalWidth + 10));
}

var listData, timer, itemContainerWidth = 0, currentIdx = 0, currentItemTotalWidth = 0;